<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>现代群聊应用</title>
  <link rel="stylesheet" href="../../static/css/studentChat.css">
  <link rel="stylesheet" href="../../static/css/all.min.css">
  <link rel="stylesheet" href="../../static/bootstrap/bootstrap/dist/css/bootstrap.min.css">
</head>
<body>
<div class="alert alert-danger" style="display: none;">
  <i class="fas fa-exclamation-circle"></i>
  <span id="error-message" class="errorMessage">用户名或密码错误</span>
</div>
<!-- 正确提示框 -->
<div class="alert alert-success" id="success-alert" style="display: none;">
  <i class="fas fa-check-circle"></i>
  <span id="success-message">登录成功</span>
  <button class="alert-close">&times;</button>
</div>
<div class="chat-app">
  <div class="sidebar">
    <div class="sidebar-header">
      <h2>在线用户</h2>
    </div>
    <div class="search-box">
      <input type="text" placeholder="搜索用户...">
      <i class="fas fa-search"></i>
    </div>
    <div class="chat-list" id="online-users">
      <!-- 在线用户将在这里动态添加 -->
    </div>
  </div>
  <!-- 主聊天区 -->
  <div class="main-chat">
    <div class="chat-header">
      <div class="header-left">
        <div class="avatar">
          <img src="https://lyf-java-ai.oss-cn-beijing.aliyuncs.com/2025/07/135a9a6b-e900-4e76-8108-b90bb04b1cde.jpg" alt="群聊头像">
        </div>
        <div class="chat-title">
          <h3>技术交流群</h3>
          <p>在线: 张三, 李四, 王五</p>
        </div>
      </div>
    </div>

    <div class="chat-messages" id="chat-messages">
      <!-- 消息将在这里动态添加 -->
      <div class="message-date">今天</div>

      <div class="message received">
        <div class="avatar">
          <img src="https://via.placeholder.com/32" alt="用户头像">
        </div>
        <div class="message-content">
          <div class="message-info">
            <span class="sender">张三</span>
            <span class="time">10:30</span>
          </div>
          <div class="message-text">
            大家好，这是我们新项目的设计方案，请各位看看有什么建议。
          </div>
        </div>
      </div>

      <div class="message received">
        <div class="avatar">
          <img src="https://via.placeholder.com/32" alt="用户头像">
        </div>
        <div class="message-content">
          <div class="message-info">
            <span class="sender">李四</span>
            <span class="time">10:32</span>
          </div>
          <div class="message-text">
            我觉得整体不错，但第二部分可能需要调整。
          </div>
        </div>
      </div>

      <div class="message sent">
        <div class="avatar">
          <img src="https://via.placeholder.com/32" alt="我的头像">
        </div>
        <div class="message-content">
          <div class="message-info">
            <span class="time">10:35</span>
          </div>
          <div class="message-text">
            好的，我会考虑你的建议。其他人有什么想法吗?
          </div>
          <div class="message-status">
            <i class="fas fa-check-double"></i>
          </div>
        </div>
      </div>

      <div class="message received">
        <div class="avatar">
          <img src="https://via.placeholder.com/32" alt="用户头像">
        </div>
        <div class="message-content">
          <div class="message-info">
            <span class="sender">王五</span>
            <span class="time">10:40</span>
          </div>
          <div class="message-text">
            <img src="https://via.placeholder.com/200x150" alt="图片" class="message-image">
          </div>
        </div>
      </div>
    </div>

    <div class="chat-input">
      <div class="input-tools">
        <button class="btn-icon" id="emoji-btn" title="表情">
          <i class="far fa-smile"></i>
        </button>
        <button class="btn-icon" id="image-btn" title="图片">
          <i class="far fa-image"></i>
        </button>
        <button class="btn-icon" id="file-btn" title="文件">
          <i class="far fa-file"></i>
        </button>
        <!-- 新增隐藏的input元素 - 确保放在input-tools内部 -->
        <input type="file" id="imageInput" style="display: none;" accept="image/* " enctype="multipart/form-data">
        <input type="file" id="fileInput" style="display: none;" accept="*" enctype="multipart/form-data">
      </div>
      <div class="input-box">
        <input type="text" id="message-input" placeholder="输入消息..." autocomplete="off">
      </div>
      <button class="btn-send" id="send-btn">发送</button>
    </div>
  </div>

  <!-- 右侧信息栏 -->
  <div class="info-sidebar">
    <div class="info-header">
      <h3>群组信息</h3>
      <button class="btn-icon" id="close-info">
        <i class="fas fa-times"></i>
      </button>
    </div>
    <div class="group-info">
      <div class="group-avatar">
        <img src="https://via.placeholder.com/100" alt="群组头像">
      </div>
      <h3 class="group-name">技术交流群</h3>
      <p class="group-desc">讨论前端开发和技术分享</p>

      <div class="info-section">
        <h4>群成员 (15)</h4>
        <div class="member-list">
          <div class="member">
            <div class="avatar">
              <img src="https://via.placeholder.com/40" alt="成员头像">
            </div>
            <span class="name">张三 (群主)</span>
          </div>
          <div class="member">
            <div class="avatar">
              <img src="https://via.placeholder.com/40" alt="成员头像">
            </div>
            <span class="name">李四</span>
          </div>
          <div class="member">
            <div class="avatar">
              <img src="https://via.placeholder.com/40" alt="成员头像">
            </div>
            <span class="name">王五</span>
          </div>
          <button class="btn-more">查看全部 <i class="fas fa-chevron-down"></i></button>
        </div>
      </div>

      <div class="info-section">
        <h4>群公告</h4>
        <div class="announcement">
          <p>请大家文明交流，禁止发送广告和不当言论。</p>
          <span class="time">2023-06-15 更新</span>
        </div>
      </div>

      <div class="info-actions">
        <button class="btn-action"><i class="fas fa-search"></i> 查找消息</button>
        <button class="btn-action"><i class="fas fa-bell"></i> 通知设置</button>
        <button class="btn-action"><i class="fas fa-user-plus"></i> 邀请成员</button>
        <button class="btn-action danger"><i class="fas fa-sign-out-alt"></i> 退出群聊</button>
      </div>
    </div>
  </div>
</div>

<!-- Emoji 选择器 -->
<div class="emoji-picker" id="emoji-picker">
  <div class="emoji-header">
    <h4>选择表情</h4>
    <button class="btn-icon close-emoji">
      <i class="fas fa-times"></i>
    </button>
  </div>
  <div class="emoji-categories">
    <button class="active"><i class="far fa-smile"></i></button>
    <button><i class="far fa-laugh-squint"></i></button>
    <button><i class="far fa-kiss-wink-heart"></i></button>
    <button><i class="far fa-surprise"></i></button>
  </div>
  <div class="emoji-grid">
    <!-- 默认显示笑脸分类 -->
    <div class="emoji-group" data-group="smile">
      <button>😀</button>
      <button>😊</button>
      <button>🙂</button>
      <button>😄</button>
      <button>😁</button>
      <button>😀</button>
      <button>😊</button>
      <button>🙂</button>
      <button>😄</button>
      <button>😁</button>
    </div>

    <div class="emoji-group" data-group="laugh" style="display:none">
      <button>😂</button>
      <button>🤣</button>
      <button>😆</button>
      <button>😅</button>
      <button>😄</button>
      <button>😀</button>
      <button>😊</button>
      <button>🙂</button>
      <button>😄</button>
      <button>😁</button>
    </div>

    <div class="emoji-group" data-group="kiss" style="display:none">
      <button>😍</button>
      <button>🥰</button>
      <button>😘</button>
      <button>😗</button>
      <button>😚</button>
      <button>😀</button>
      <button>😊</button>
      <button>🙂</button>
      <button>😄</button>
      <button>😁</button>
    </div>

    <div class="emoji-group" data-group="surprise" style="display:none">
      <button>😲</button>
      <button>😳</button>
      <button>😨</button>
      <button>😱</button>
      <button>😵</button>
    </div>
  </div>
</div>
<script src="../../static/js/jquery.js"></script>
<script src="../../static/js/jquery.cookie.js"></script>
<script src="../../static/js/studentChat.js"></script>
</body>
</html>